<?php
namespace app\validate\member;

use think\Validate;

class Level extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
	protected $rule = [
        'name' => [ 'require' ],
        'product_dis' => [ 'number', 'min' => 1, 'max' => 100 ],
        'service_dis' => [ 'require', 'number', 'min' => 1, 'max' => 100 ],
        'live_dis' => [ 'require', 'number', 'min' => 1, 'max' => 100 ],
        'foster_dus' => [ 'require', 'number', 'min' => 1, 'max' => 100 ],
        'has_integral'
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message = [
        'phone' => '请填写正确的手机号',
        'phone.require' => '请填写手机号',
        'password' => '请填写正确的密码',
        'password.require' => '请填写密码'
    ];

    protected $scene = [
        'add' => [ 'phone', 'password' ]
    ];
}
